package com.wf.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * Created by wufei on 2017/6/6.
 */
@RestController
public class MovieController {

    @Autowired
    RestTemplate restTemplate;

    @GetMapping(value = "/user/{id}")
    public User findByid(@PathVariable Long id){
        return restTemplate.getForObject("http://provide-user/user/"+id,User.class);
    }
}
